<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>WebSocket Test</title>
</head>
<body>
    <button onclick="testWebSocket()">Test WebSocket</button>

    <script>
        function testWebSocket() {
            const ws = new WebSocket("ws://localhost:8080/ws");
            
            ws.addEventListener("open", function(event) {
                ws.send("Hello Server!");
            });
            
            ws.addEventListener("message", function(event) {
                console.log("Received from server: " + event.data);
            });
        }
    </script>
</body>
</html>